Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Runtime.InteropServices

Namespace interop

    Public Module SendMessageInterop
        Const WM_SETTINGCHANGE As Integer = &H1A
        Const HWND_BROADCAST As Integer = (-1)
        Const SMTO_ABORTIFHUNG As Integer = &H2

        <DllImport("user32", EntryPoint:="SendMessageTimeoutA", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)> _
        Private Function SendMessageTimeout(ByVal hwnd As Integer, ByVal msg As Integer, ByVal wParam As Integer, ByVal lParam As String, ByVal fuFlags As Integer, ByVal uTimeout As Integer, _
   ByRef lpdwResult As Integer) As Integer
        End Function

        Public Function BroadcastSettingsChange() As Integer
            Dim rtnValue As Integer = 0
            Return SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, "intl", SMTO_ABORTIFHUNG, 5000, rtnValue)
        End Function


    End Module
End Namespace
